package com.zhixinhuixue.zsyte.xxx.ui.activity

import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.view.WindowManager
import com.zhixinhuixue.zsyte.xxx.R
import com.zhixinhuixue.zsyte.xxx.app.App
import com.zhixinhuixue.zsyte.xxx.app.api.NetUrl
import com.zhixinhuixue.zsyte.xxx.app.base.BaseActivity
import com.zhixinhuixue.zsyte.xxx.app.ext.mmkv
import com.zhixinhuixue.zsyte.xxx.data.annotation.ValueKey
import com.zhixinhuixue.zsyte.xxx.data.response.TokenInfo
import com.zhixinhuixue.zsyte.xxx.databinding.ActivitySplashBinding
import com.zhpan.bannerview.BannerViewPager
import me.hgj.mvvmhelper.base.BaseViewModel
import me.hgj.mvvmhelper.ext.toStartActivity
import me.hgj.mvvmhelper.util.SPUtil

/**
 * 作者　: hegaojian
 * 时间　: 2020/12/3
 * 描述　:
 */
class SplashActivity : BaseActivity<BaseViewModel, ActivitySplashBinding>() {

    private var resList = arrayOf(R.drawable.aaa)
    private var mTokenInfo: String? = null
    private lateinit var mViewPager: BannerViewPager<Int>

    override fun initView(savedInstanceState: Bundle?) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
        }


//            try {
//                mTokenInfo = SPUtil.get(
//                    App.instance.applicationContext,
//                    SPUtil.USER_INFO,
//                    ""
//                ) as String
//            } catch (e: Exception) {
//                e.printStackTrace()
//            }
//
//            if (!TextUtils.isEmpty(mTokenInfo)) {
//                jumpToMainActivity()
//            } else {
//
//            }
        jumpToLoginActivity()


    }

    private fun jumpToMainActivity() {
        toStartActivity(WLSJActivity::class.java)
        finish()
    }

    private fun jumpToLoginActivity() {
        toStartActivity(LoginActivity::class.java)
        finish()
    }

    override fun showToolBar() = false

}